package org.meb.conquest.web.core;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HttpSessionListenerImpl implements HttpSessionListener {

	private static final Logger log = LoggerFactory.getLogger(HttpSessionListenerImpl.class);

	@Override
	public void sessionCreated(HttpSessionEvent event) {
		log.info("session created: {}", event.getSession().getId());
		event.getSession().setAttribute("valid", true);
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent event) {
		log.info("session destroyed: {}", event.getSession().getId());
		event.getSession().removeAttribute("valid");
	}
}
